{include file='public/header'}
<!--主体-->

<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">增添代理</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">


            {foreach $arr as $v}
                <div class="layui-form-item">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="old_password"
                               value="{$v.username}"  id="name"  disabled required lay-verify="required" placeholder=""
                               class="layui-input">
                        <span class="name_info"></span>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">手机</label>
                    <div class="layui-input-block">
                        <input type="text" name="old_password" value="{$v.phone}" disabled id="user"  required lay-verify="required" placeholder=""

                               class="layui-input">
                        <span class="user_info"></span>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">身份证</label>
                    <div class="layui-input-block">
                        <input type="text" name="old_password" value="{$v.card}" disabled id="password" required lay-verify="required"
                               placeholder="" class="layui-input">
                        <span class="pass_info"></span>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">分销商</label>
                    <div class="layui-input-block">
                        <input type="text" name="confirm_password" value="{$v.dl_user}" disabled id="userpassword"  placeholder=""

                               class="layui-input">
                        <span class="upass_info"></span>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">申请卡种</label>
                    <div class="layui-input-block">
                        <input type="text" name="confirm_password" disabled value="{$v.bark_style}" id="photo"
                               placeholder="" class="layui-input">
                        <span class="photo_info"></span>
                    </div>
                </div>


                {switch name="v.Auditing"}
                {case  value="0"}
                <div class="layui-form-item">
                    <span class="layui-form-label">
                        <label><input type="radio" name="confirm_password" class="input1" value="未审核" id="change1" checked>未审核</label>
                    </span>
                </div>

                <label class="layui-form-label"><input type="radio" name="confirm_password" class="input1" value="审核" id="change2"  >审核</label>
                {/case}
                {case value ="1"}
                <div class="layui-form-item">
                    <span class="layui-form-label">
                        <label><input type="radio" name="confirm_password" value="未审核" id="change1" class="input1" checked>未审核</label>
                    </span>
                </div>
                <label class="layui-form-label"><input type="radio" name="confirm_password" value="审核" id="change2" class="input1"  checked>审核</label>
                {/case}
                {/switch}
                {/foreach}


            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn"  lay-filter="*" onclick="numchk()">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>

        </div>
    </div>
</div>
</div>
</div>

</body>
</html>
<script>
        var numchk =function () {
            var Request = new Object();
            Request = GetRequest();
            var id = Request['id'];
            var state = $('input[class="input1"]:checked').val();
            $.ajax({
                url:"./edit_Ajax",
                data:{i:id,s:state},
                async:false,
                type:"post",
                success:function (msg) {

                    if(msg.error == '1'){
                        alert(msg.msg);
                        window.location.href = msg.url;
                    }else if(msg.error==0){
                        alert(msg.msg);
                    }
                }
            })
        }
        function GetRequest() {
            var url = location.search; //获取url中"?"符后的字串
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1);
                strs = str.split("&");
                for(var i = 0; i < strs.length; i ++) {
                    theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }
</script>